<div class="main-content">
    <div class="section__content section__content--p20">
        <div class="container-fluid">
            <div class="row m-b-30">
                <div class="col-lg-12">
                    <div class="overview-wrap">
                        <h2 class="title-1">伪静态</h2>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                            <strong>伪静态</strong>
                        </div>
                        <div class="card-body">
                            <form class="form-horizontal" role="form" name="form" id="form" method="post"
                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh"
                                  action="index.php?r=admin/rewrite/edit" enctype="multipart/form-data">
                                <input type="hidden" name="YII_CSRF_TOKEN" value="<?php echo Yii::app()->request->csrfToken; ?>"/>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">伪静态环境监测</label>
                                    <div class="col-sm-10">
                                        <label style="margin-top:8px;">
                                            <?php
                                            $result = apache_get_modules();
                                            if (in_array('mod_rewrite', $result)) {
                                                echo '<i class="fa fa-check-square text-success"></i>';
                                            } else {
                                                echo '<i class="fa fa-minus-square text-danger"></i>';
                                            }
                                            ?>
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">开启伪静态</label>
                                    <div class="col-sm-10">
                                        <?php
                                        if($isrewrite == 1){
                                            ?>
                                            <div class="radio">
                                                <label>
                                                    <input name="isrewrite" checked="checked" type="radio" value="1"/>是&nbsp;&nbsp;
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label>
                                                    <input name="isrewrite" type="radio" value="0"/>否
                                                </label>
                                            </div>
                                            <?php
                                        }else{
                                            ?>
                                            <div class="radio">
                                                <label>
                                                    <input name="isrewrite" type="radio" value="1"/>是&nbsp;&nbsp;
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label>
                                                    <input name="isrewrite" checked="checked" type="radio" value="0"/>否
                                                </label>
                                            </div>
                                            <?php
                                        }
                                        ?>

                                    </div>
                                </div>
                                <div class="form-group">
                                    <button  type="submit" name="submit" id="submit" class="btn btn-primary btn-lg btn-block">保存</button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        initPage();
    });
    function initPage() {
        $('#form').bootstrapValidator();
        $('#form').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (formData, jqForm, options) {
                return $('#form').data('bootstrapValidator').isValid();
            },
            success: function (res) {
                if (message(res)) {

                }
            }
        });
    }
</script>